﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zyg.SSO.Core.Business
{
    public class Module
    {
        #region Fields and Properties

        private Guid id;
        private string name = String.Empty;
        private DateTime dateCreated;
        private string remark = String.Empty;

        /// <summary>
        /// Unique identifier of module
        /// </summary>
        public Guid Id
        {
            get { return id; }
            set { id = value; }
        }

        /// <summary>
        /// Name of module.
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// Date Created.
        /// </summary>
        public DateTime DateCreated
        {
            get { return dateCreated; }
            set { dateCreated = value; }
        }

        /// <summary>
        /// Remark of Module
        /// </summary>
        public string Remark
        {
            get { return remark; }
            set { remark = value; }
        }

        #endregion

        #region Static elements

        /// <summary>
        /// 管理员管理
        /// </summary>
        public static readonly Module Admin;

        /// <summary>
        /// 用户管理
        /// </summary>
        public static readonly Module Account;

        /// <summary>
        /// 角色权限管理
        /// </summary>
        public static readonly Module Role;

        /// <summary>
        /// 应用系统管理
        /// </summary>
        public static readonly Module App;

        /// <summary>
        /// 日志管理
        /// </summary>
        public static readonly Module Log;

        #endregion

        #region Constructors

        static Module()
        {
            Admin = new Module
            {
                Id = new Guid("fdd870f6-ec6b-458b-a7e3-05bda24f68bd"),
                Name = "管理员管理",
                DateCreated = DateTime.Now,
                Remark = "管理系统管理员模块"
            };

            Account = new Module
            {
                Id = new Guid("764c3f49-d82c-4179-bb04-7430714da537"),
                Name = "帐户管理",
                DateCreated = DateTime.Now,
                Remark = "管理系统帐户模块"
            };

            Role = new Module
            {
                Id = new Guid("47465472-4c81-4dd9-b687-ae1a684d78c6"),
                Name = "角色管理",
                DateCreated = DateTime.Now,
                Remark = "管理系统角色模块"
            };

            App = new Module
            {
                Id = new Guid("fd23b7fc-d12c-4b65-9f77-e0ceb33ca9fa"),
                Name = "应用系统管理",
                DateCreated = DateTime.Now,
                Remark = "管理应用系统模块"
            };

            Log = new Module
            {
                Id = new Guid("ffdd15a8-4f9f-4047-a0fb-8025d590afcc"),
                Name = "日志管理",
                DateCreated = DateTime.Now,
                Remark = "管理系统日志模块"
            };
        }

        protected Module()
        {
        }

        private Module(Guid id, string name, DateTime dateCreated, string remark)
        {
            this.id = id;
            this.name = name;
            this.dateCreated = dateCreated;
            this.remark = remark;
        }

        #endregion
    }
}
